/*
 * DevicesIIC.h
 *
 *      Author: Honrun
 */

#ifndef DEVICESIIC_H_
#define DEVICESIIC_H_


#define I2C_BYTE_TIME_OUT   1000
#define I2C_BUSY_TIME_OUT   10000
#define I2C_START_OUT       100



void vIIC1Init(void);
void vIIC1DeInit(void);
void vIIC1DMAInit(void);


int8_t cI2CxWriteDatas(I2C_Module* I2Cx, uint16_t usIDAddr, uint16_t usRegAddr, uint8_t* pBuffer, int32_t iLength);
int8_t cI2CxReadDatas(I2C_Module* I2Cx, uint16_t usIDAddr, uint16_t usRegAddr, uint8_t* pBuffer, int32_t iLength);

int8_t cI2CxDMAWriteDatas(uint32_t i2c_periph, uint16_t usIDAddr, uint16_t usRegAddr, uint8_t* pBuffer, int32_t iLength);
int8_t cI2CxDMAReadDatas(uint32_t i2c_periph, uint16_t usIDAddr, uint16_t usRegAddr, uint8_t* pBuffer, int32_t iLength);


#endif /* DEVICESIIC_H_ */
